home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PTMID3.ZIP / PTMID.H < prev    next >
C/C++ Source or Header  |  1994-07-02  |  2KB  |  99 lines

  1. /*
  2.  * ptmid.h: Header file for ptmid.
  3.  *
  4.  * Author: Andrew Scott  (c)opyright 1994
  5.  *
  6.  * Date: 17/11/1993 ver 0.0
  7.  *       8/1/1994   ver 0.1
  8.  *       11/2/1994  ver 0.2
  9.  */
  10.  
  11. #ifndef _PTMIDH
  12. #define _PTMIDH
  13.  
  14. #define MAXFILELEN 80
  15. #define PTVER "0.3"
  16. #define MAXSAMPS 31
  17. #define MAXCHANS 32
  18. #define DIVSPERPAT 64
  19. #define DEFCONFIG "ptmid.cfg"
  20.  
  21. #define C2FREQUENCY 8287
  22. #define MIDDLEC 60
  23.  
  24. #ifndef SEEK_SET
  25. #define SEEK_SET 0
  26. #define SEEK_CUR 1
  27. #define SEEK_END 2
  28. #endif
  29.  
  30. #define ERROR perror(szProgram)
  31.  
  32. typedef char *Sz;
  33. typedef char Fn[MAXFILELEN];
  34.  
  35. typedef struct FX_ FX; /** FX structure represents effects **/
  36. struct FX_ {
  37.   unsigned long delay;
  38.   char eff;
  39.   int param;
  40.   FX *pfx;
  41. };
  42. typedef struct EI_ EI; /** EI structure represents event info **/
  43. struct EI_ {
  44.     unsigned long effect;
  45.   int pitch; /*** If pitch == -1, effect is qpm, else duration ***/
  46.   char inst, vol;
  47.   FX *pfxTail; /*** pfxTail points to tail of FX circular list. ***/
  48.   EI *pei;
  49. };
  50. typedef struct Tune_ Tune; /** Tune structure holds list of events **/
  51. struct Tune_ {
  52.     unsigned long count;
  53.     Tune *ptune;
  54.     EI *pei;
  55. };
  56.  
  57. typedef struct NRL_ NRL; /** NRL structure represents note record list **/
  58. struct NRL_ {
  59.     int inst, vol;
  60.   FX *pfxTail;
  61.     Tune *ptuneNow;
  62.     NRL *pnrl;
  63. };
  64.  
  65. typedef struct SI_ SI; /** SI structure represents sample info tree **/
  66. struct SI_ {
  67.     Sz fnSample;
  68.   int pitch, perpitch, sample, bFinetune;
  69.   unsigned freq, wLppos, wLplen;
  70.     SI *psiL, *psiR;
  71. };
  72.  
  73. typedef struct { /** MS structure represents a mix of samples **/
  74.     char szName[22];
  75.   char bDefvol;
  76.   SI *psi;
  77. } MS;
  78.  
  79. extern char bDrumch, szId[5];
  80. extern int fNocopy, fQuiet, fExtend, fStats, wPatmax, wMaxchan, wQuantval;
  81. extern int wRgmode, wModfmt;
  82. extern unsigned wQuant;
  83. extern SI *rgpsiDrum[128], **rgppsiIns[129], *psiTree;
  84. extern Sz szTitle, szProgram;
  85. extern MS rgmsDecided[MAXSAMPS];
  86. extern Fn fnSampath;
  87.  
  88. Tune *PtuneLoadFn(Sz);
  89.  
  90. void ResolvePtune(Tune *);
  91.  
  92. void SavePtunePfile(Tune *, FILE *);
  93.  
  94. int ValidquantSz(Sz);
  95.  
  96. void Error(Sz, ...);
  97.  
  98. #endif
  99.